﻿@{
    Layout = null;
}
<!doctype html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>基于Bootstrup 3可预览的HTML5文件上传插件</title>
    @*<link href="css/bootstrap.min.css" rel="stylesheet" />*@
    <link href="~/Customjs/css/bootstrap.min.css" rel="stylesheet" />
    @*<link rel="stylesheet" type="text/css" href="css/default.css">*@
    <link href="~/Customjs/css/default.css" rel="stylesheet" />
    @*<link href="css/fileinput.css" media="all" rel="stylesheet" type="text/css" />*@
    <link href="~/Customjs/css/fileinput.css" rel="stylesheet" />
</head>
<body>

    <div class="htmleaf-container">
        <header class="htmleaf-header">
            <h1>可预览的HTML5文件上传插件 </h1>
        </header>

        <div class="container kv-main">
            <form enctype="multipart/form-data">
                <hr>
                <div class="form-group">
                    <input id="file-4" type="file" class="file" data-upload-url="JSImportExcel">
                </div>
                <hr>
            </form>
        </div>
    </div>

    <script src="~/Customjs/js/jquery.min.js"></script>
    <script src="~/Customjs/js/fileinput.js"></script>
    <script src="~/Customjs/js/fileinput_locale_zh.js"></script>
    <script src="~/Customjs/js/bootstrap.min.js"></script>
    <script>
        $("#file-4").fileinput({
            uploadExtraData: {
                kvId: '10'
            }
        }).on("fileuploaded", function (event, data) { 
            alert(data.response.data) 
        });


        $(".btn-warning").on('click', function () {
            if ($('#file-4').attr('disabled')) {
                $('#file-4').fileinput('enable');
            } else {
                $('#file-4').fileinput('disable');
            }
        });
        $(".btn-info").on('click', function () {
            $('#file-4').fileinput('refresh', { previewClass: 'bg-info' });
        });

        $(document).ready(function () {
            $("#test-upload").fileinput({
                'showPreview': false,
                'allowedFileExtensions': ['jpg', 'png', 'gif'],
                'elErrorContainer': '#errorBlock'
            });
        });
    </script>
</body>
</html>
